﻿using System.Collections.Generic;

namespace suirui.ZhuMu.Model.Common
{
    /// <summary>
    /// 导入结果
    /// </summary>
    public class WhiteListImportModel
    {
        /// <summary>
        /// 导入总条数
        /// </summary>
        public int Count { get; set; }
        /// <summary>
        /// 导出成功数量
        /// </summary>
        public int SuccessCount { get; set; }
        /// <summary>
        /// 导入失败数量
        /// </summary>
        public int FailedCount { get; set; }

        /// <summary>
        /// 导入失败列表：不包含空白行
        /// </summary>
        public List<WhiteListImportFailedRow> FailedList { get; set; } = new List<WhiteListImportFailedRow>();
        /// <summary>
        /// 空白行号
        /// </summary>
        public List<int> NullRowIndex { get; set; } = new List<int>();

        public override string ToString()
        {
            string failedListStr = string.Empty;
            string nullRowIndex = string.Empty;
            FailedList?.ForEach(p=> { failedListStr += p.ToString(); });
            NullRowIndex?.ForEach(p=> { nullRowIndex +=( "["+p.ToString()+"],"); });
            return $"Count:{Count},SuccessCount:{SuccessCount},FailedCount:{FailedCount},FailedList:{failedListStr},NullRowIndex:{nullRowIndex.TrimEnd(',')}";
        }
    }
}
